package com.hbnu.list;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class CollectionsDemo {
    public static void main(String[] args) {
        List<Integer> ages = new ArrayList<>();

        ages.add(5);
        ages.add(7);
        ages.add(2);
        ages.add(6);
        ages.add(1);
        ages.add(4);

        Collections.addAll(ages, 10,18,6);
        System.out.println(ages);

        System.out.println("=======================================================");
        Collections.reverse(ages);
        System.out.println(ages);

        System.out.println("=======================================================");
        Collections.shuffle(ages);
        System.out.println(ages);

        System.out.println("=======================================================");
        Collections.sort(ages);
        System.out.println(ages);



    }
}
